package com.jht.bletool2java;

import android.annotation.SuppressLint;
import android.app.Application;
import android.content.Context;

import com.jht.bletool2java.config.BLEConfiguration;

public class BLEApplication extends Application {
    private static final String TAG = "BLEApplication";

    @SuppressLint("StaticFieldLeak")
    private static Context mContext;
    private static BLEConfiguration mBleConfiguration = new BLEConfiguration(20);

    @Override
    public void onCreate() {
        super.onCreate();
        mContext = getApplicationContext();
    }

    public static Context getBLEApplicationContext(){
        return mContext;
    }

    public static BLEConfiguration getBLEConfiguration(){
        if(mBleConfiguration == null) throw new RuntimeException("BLEConfiguration is not initialized");

        return mBleConfiguration;
    }
}
